﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Data.Objects;
using log4net;

namespace ConsoleOldToNew
{
    class DTU_Send
    {
        private static readonly ILog Log = LogManager.GetLogger(typeof(DTU_Send));

        //private int enterpriseId = 0;
        //private int letportId = 0;
        //private string MN = "";
        //private string TranPWD = "";
        private DataSend objDataSend;
        private int int传输间隔;
        public DTU_Send(string TranPWD, SocketClient objSocketClient, string str服务器IP, int int服务器端口, int int数据发送之间间隔, int int传输间隔)
       {
          
           //this.enterpriseId = enterpriseId;
           //this.letportId = letportId;
           //this.MN = MN;
           //this.TranPWD = TranPWD;
           this.int传输间隔 = int传输间隔;
           objDataSend = new DataSend(TranPWD, objSocketClient, str服务器IP, int服务器端口, int数据发送之间间隔);

       }

       public void DTU_SendMonitor()
       {

           while (true)
           {

               try
               {

                   objDataSend.Socket_Data_Send();

                   Thread.Sleep(int传输间隔);

                  // GlobalVariable.HashtableDataMapping.Clear();


               }
               catch (Exception ex)
               {
                   try
                   {
                       Log.Error(ex);
                      // LogText.WriteData(DateTime.Now.ToString() + "类：DTU_Send，方法：DTUMonitor总，" + ex.Message);
                   }
                   catch
                   { 
                   
                   }
               
               }


           }
       }


    }
}
